package j2eelogin.actions;

import j2eelogin.actionforms.AFConfirmation;
import j2eelogin.actionforms.AFInscription;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class AConfirmation extends Action {
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest req, HttpServletResponse res) throws Exception {

		if(form instanceof AFConfirmation)
		{
			AFConfirmation confirmationForm = (AFConfirmation) form;
			
			if(confirmationForm.getConfirmationString().equals("1234"))
				return mapping.findForward("sucess");
		}
		return mapping.findForward("fail");
	}
}
